import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:th_credentials_manager/th_result.dart';

import 'th_credentials.dart';
import 'th_credentials_manager_method_channel.dart';

abstract class ThCredentialsManagerPlatform extends PlatformInterface {
  /// Constructs a ThCredentialsManagerPlatform.
  ThCredentialsManagerPlatform() : super(token: _token);

  static final Object _token = Object();

  static ThCredentialsManagerPlatform _instance =
      MethodChannelThCredentialsManager();

  /// The default instance of [ThCredentialsManagerPlatform] to use.
  ///
  /// Defaults to [MethodChannelThCredentialsManager].
  static ThCredentialsManagerPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [ThCredentialsManagerPlatform] when
  /// they register themselves.
  static set instance(ThCredentialsManagerPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<THResult<List<THCredentials>>> getAllCredentials() {
    throw UnimplementedError('getAllCredentials() has not been implemented.');
  }

  Future<THResult<bool>> deleteCredentialsBy(String borderAgentID) {
    throw UnimplementedError('deleteCredentialsBy() has not been implemented.');
  }

  Future<THResult<bool>> storeCredentials({
    required String borderAgentID,
    required String activeDataSet,
  }) {
    throw UnimplementedError('storeCredentials() has not been implemented.');
  }

  Future<THResult<bool>> isPreferred({
    required String activeDataSet,
  }) {
    throw UnimplementedError('isPreferred() has not been implemented.');
  }
}
